<template>
	<view>
		<uni-indexed-list :options="list" :showSelect="false" @click="bindClick"></uni-indexed-list>
	</view>
</template>

<script>
	import uniIndexedList from "@/component/uni-indexed-list/uni-indexed-list.vue"
	export default {
		data(){
			return {
				list1:[],
				list: [
					{"letter": "A","data": []},
					{"letter": "B","data": []},
					{"letter": "C","data": []},
					{"letter": "D","data": []},
					{"letter": "E","data": []},
					{"letter": "F","data": []},
					{"letter": "G","data": []},
					{"letter": "H","data": []},
					{"letter": "I","data": []},
					{"letter": "J","data": []},
					{"letter": "K","data": []},
					{"letter": "L","data": []},
					{"letter": "M","data": []},
					{"letter": "N","data": []},
					{"letter": "O","data": []},
					{"letter": "P","data": []},
					{"letter": "Q","data": []},
					{"letter": "R","data": []},
					{"letter": "S","data": []},
					{"letter": "T","data": []},
					{"letter": "U","data": []},
					{"letter": "V","data": []},
					{"letter": "W","data": []},
					{"letter": "X","data": []},
					{"letter": "Y","data": []},
					{"letter": "Z","data": []},
				]
			}
		},
		components: {uniIndexedList},
		mounted() {
			this.pinpai()
		},
		methods: {
			bindClick:function(e){
				console.log(e)
			},
			// 品牌获取
			pinpai:function(){
				this.$get('fxj/base/getcarbrand').then(res=>{
					this.list1 = JSON.parse(res.data.message)
					this.list.forEach(item=>{
						this.list1.forEach(item1=>{
							if(item.letter == item1.Initial){
								item.data.push(item1.Name)
							}
						})
					})
					console.log(this.list)
				})
			},
		}
	}
</script>

<style>

</style>
